@import "tailwindcss" source(none);
@plugin "tailwindcss-animate";
@plugin "@tailwindcss/typography";

@source "../../components/common/**/*.{js,ts,jsx,tsx,mdx}";
@source "../../components/web/**/*.{js,ts,jsx,tsx,mdx}";
@source "../*.{js,ts,jsx,tsx,mdx}";
@source "../(web)/**/*.{js,ts,jsx,tsx,mdx}";

@theme {
  --font-system: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  --header-height: 3.125rem;
  --header-top: 0rem;

  --color-primary: hsl(15 63% 40%);
  --color-background: hsl(0 0% 100%);
  --color-muted: hsl(0 0% 40%);
  --color-secondary: hsl(0 0% 30%);
  --color-foreground: hsl(0 0% 13%);

  --color-card: hsl(0 0% 98%);
  --color-card-dark: hsl(0 0% 96%);

  --color-border: hsl(0 0% 88%);
  --color-border-dark: hsl(0 0% 83%);

  --tracking-micro: -0.0125em;

  --font-sans: var(--font-geist), var(--font-system);
  --font-display: var(--font-geist), var(--font-system);

  --text-5xl: 2.75rem;

  --scale-flip: -1;

  --grid-template-columns-2xs: repeat(auto-fill, minmax(10rem, 1fr));
  --grid-template-columns-xs: repeat(auto-fill, minmax(12rem, 1fr));
  --grid-template-columns-sm: repeat(auto-fill, minmax(14rem, 1fr));
  --grid-template-columns-md: repeat(auto-fill, minmax(16rem, 1fr));
  --grid-template-columns-lg: repeat(auto-fill, minmax(18rem, 1fr));
  --grid-template-columns-xl: repeat(auto-fill, minmax(20rem, 1fr));

  --animate-shimmer: shimmer 1.25s cubic-bezier(0.5, 0.25, 0.25, 0.5) infinite;

  @keyframes shimmer {
    from {
      left: -90%;
    }
    to {
      left: 90%;
    }
  }
}

/*
  The default border color has changed to `currentColor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    @apply border-border;
  }
}

@utility prose {
  & [id] {
    @apply relative;
  }

  & [id] > a[tabindex="-1"] {
    @apply opacity-0;
    @apply absolute;
    @apply right-full;
    @apply no-underline;
    @apply p-2;
    @apply -m-2;
    @apply mr-0;
  }

  & [id] > a[tabindex="-1"]:after {
    @apply content-["#"];
  }

  & [id]:hover > a[tabindex="-1"] {
    @apply opacity-25;
  }

  & [id]:hover > a[tabindex="-1"]:hover {
    @apply opacity-100;
  }
}

@layer base {
  @media (prefers-color-scheme: dark) {
    :root {
      --color-primary: hsl(15 63% 50%);
      --color-background: hsl(0 0% 8%);
      --color-muted: hsl(0 0% 60%);
      --color-secondary: hsl(0 0% 70%);
      --color-foreground: hsl(0 0% 87%);

      --color-card: hsl(0 0% 11%);
      --color-card-dark: hsl(0 0% 13%);

      --color-border: hsl(0 0% 18%);
      --color-border-dark: hsl(0 0% 20%);
    }
  }

  @media (prefers-reduced-motion) {
    * {
      view-transition-name: none !important;
      animation: none !important;
    }
  }

  * {
    @apply underline-offset-2;
  }

  hr {
    @apply border-foreground;
    @apply opacity-10;
  }
}

a,
button,
label[for],
[href] [class*="group-hover"] {
  @apply transition;
  @apply ease-out;
  @apply duration-100;
  @apply cursor-pointer;
}

svg.lucide:not([class*="stroke"]) {
  @apply stroke-[1.75]!;
}

svg.lucide:not([class*="size-"]):not([class*="h-"]) {
  @apply size-[1em]!;
}

[href] svg[class*="arrow-up-right"],
[href] svg[class*="arrow-right"],
[type] svg[class*="arrow-up-right"],
[type] svg[class*="arrow-right"] {
  @apply will-change-transform;
  @apply duration-150;
}

[href]:hover svg[class*="arrow-up-right"],
[type]:hover svg[class*="arrow-up-right"] {
  @apply translate-x-[0.1em];
  @apply -translate-y-[0.1em];
}

[href]:hover svg[class*="arrow-right"],
[type]:hover svg[class*="arrow-right"] {
  @apply translate-x-[0.15em];
}

select:not([size]) {
  @apply bg-[url('')];
  @apply dark:bg-[url('')];
  @apply bg-no-repeat;
  @apply bg-[right_0.75rem_center];
  @apply bg-[length:1.25em_1.25em];
  @apply pr-10;
}
